package pop;

import java.util.*;

import javax.swing.JOptionPane;

public class Test {

  
  public static void main(String[] args) {
   
    String email    = JOptionPane.showInputDialog("Direccion email (ej. liam@gmail.com)", "liam.agent@gmail.com");
    String password = JOptionPane.showInputDialog("Contraseña","agenteliam");
    		
    
    Conectar pop = new Conectar(email, password);
    
    try {
      
      pop.connect();
      
      List mailList = pop.listMails();
      Iterator mails = mailList.iterator();
      ReadMail mail =  null;
      while(mails.hasNext())
      {
          mail = (ReadMail) mails.next();
          mail.read();
      }
     
      pop.disconnect();

    } catch (Exception e) {
      System.out.println("Imposible conectar: " + e.getMessage());
      e.printStackTrace();
    }
  }
}